﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.Financial.Models
{

    public class ResultExpense : BaseResultInfoPaging
    {
        /// <summary>
        /// 报销单信息
        /// </summary>
        public List<ExpenseExtInfo> expenseextlist { get; set; } = new List<ExpenseExtInfo>();
    }

    public class ReqExpense : BaseUserRequest
    {
        /// <summary>
        /// 报销单基础信息
        /// </summary>
        public ExpenseBaseInfo expensebaseinfo { get; set; }
    }

    /// <summary>
    /// i 报销单基础信息
    /// </summary>
    public class ExpenseBaseInfo : BaseOperableEntity
    {
        /// <summary>
        /// 费用编号
        /// </summary>
        [RequiredConditional("optlb", "UD", ErrorMessage = "费用编号是必需的")]
        public int feeid { get; set; }
        /// <summary>
        /// 账单编号
        /// </summary>
        [RequiredConditional("optlb", "UD", ErrorMessage = "账单编号是必需的")]
        public int billid { get; set; }
        /// <summary>
        /// 结算单编号
        /// </summary>
        [RequiredConditional("optlb", "UD", ErrorMessage = "结算单编号是必需的")]
        public int fnid { get; set; }
        /// <summary>
        /// 账单类别
        /// </summary>
        public string billtp { get; set; } = "";
        /// <summary>
        /// 报销金额
        /// </summary>
        public decimal amount { get; set; }
        /// <summary>
        /// 报销描述
        /// </summary>
        public string objdesc { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal num { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal amt_payprice { get; set; }
        /// <summary>
        /// 报销总价
        /// </summary>
        public decimal amt_paytotal { get; set; }
        /// <summary>
        /// 结算方式：0-现金；1-网银；2-支票
        /// </summary>
        public string settletp { get; set; }
        /// <summary>
        /// 发票类别：0-普票；1-专票
        /// </summary>
        public string invotp { get; set; }
        /// <summary>
        /// 报销客户id
        /// </summary>
        [RequiredConditional("optlb", "I", ErrorMessage = "客户编号是必需的")]
        public int cusid { get; set; }
        /// <summary>
        /// 审批流程id
        /// </summary>
        public int revcaseid { get; set; }
        /// <summary>
        /// 税率
        /// </summary>
        public decimal taxrate { get; set; }
        /// <summary>
        /// 报销备注
        /// </summary>
        public string fnremark { get; set; } = "";
        /// <summary>
        /// 打印标志
        /// </summary>
        public string printlb { get; set; } = "N";
    }

    /// <summary>
    /// ii 报销单扩展信息
    /// </summary>
    public class ExpenseExtInfo : ExpenseBaseInfo
    {
        /// <summary>
        /// 账单类别名称
        /// </summary>
        public string billtpnm { get; set; }
        /// <summary>
        /// 发票类别名称
        /// </summary>
        public string invotpnm { get; set; }
        /// <summary>
        /// 结算单进程名称
        /// </summary>
        public string pidnm { get; set; }
        /// <summary>
        /// 结算方式名称
        /// </summary>
        public string settletpnm { get; set; }
        /// <summary>
        /// 结算客户名称
        /// </summary>
        public string cusnm { get; set; }
        /// <summary>
        /// 审批方案名称
        /// </summary>
        public string revcasenm { get; set; }
        /// <summary>
        /// 结算人姓名
        /// </summary>
        public string settlenm { get; set; }
        /// <summary>
        /// 结算完成时间
        /// </summary>
        public string settledt { get; set; }
        /// <summary>
        /// 报销单进程：1-已做费用；2-审批中；3-结算中；9-核销完成
        /// </summary>
        public string pid { get; set; }
        /// <summary>
        /// 建档时间
        /// </summary>
        public string createdt { get; set; }
        /// <summary>
        /// 建档人
        /// </summary>
        public string creator { get; set; }
        /// <summary>
        /// 已挂发票金额
        /// </summary>
        public decimal amt_invo_total { get; set; }
    }

}